Skip to content

feat: add alert types for config mismatch, erasure set health, KMS, and storage capacity#528

Merged
Praveenrajmani merged 1 commit intominio:mainfrom
Praveenrajmani:alerts
Apr 1, 2026
Merged

feat: add alert types for config mismatch, erasure set health, KMS, and storage capacity#528
Praveenrajmani merged 1 commit intominio:mainfrom
Praveenrajmani:alerts

Conversation

@Praveenrajmani
Copy link
Copy Markdown
Contributor

@Praveenrajmani Praveenrajmani commented Jan 29, 2026

Introduces a new GetAlerts admin API (POST /admin/alerts) that streams alert events from the MinIO server as newline-delimited JSON, using Go 1.23's iter.Seq2 for idiomatic range-over-function iteration.

New types:

  • Alert — the top-level alert event with type, timestamp, title, message, dedup key, and deployment/cluster metadata
  • AlertDetails — strongly-typed union struct; only one field populated per alert type
  • AlertLogOpts — query options (filter by type, check interval, max per node)

Alert types and their detail structs:

  • license-expiry (LicenseExpiryDetails) — license ID, expiry time, state
  • certificate-expiry (CertificateExpiryDetails) — common name, serial, DNS names, days until expiry
  • config-mismatch (ConfigMismatchDetails) — peer address, mismatch type (env/args/endpoints), differing values
  • erasure-set-health (ErasureSetHealthDetails) — pool/set ID, online/total drives, read+write quorum, condition
  • kms-unavailable (KMSUnavailableDetails) — KMS type
  • storage-capacity (StorageCapacityDetails) — free/total bytes, free percent

Also adds AlertInternalSubSys, AlertWebhookSubSys, and AlertKafkaSubSys subsystem constants to parse-config.go for alert routing configuration.

Copy link
Copy Markdown
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some clarification needed.

@Praveenrajmani Praveenrajmani self-assigned this Feb 2, 2026
@Praveenrajmani Praveenrajmani force-pushed the alerts branch 3 times, most recently from 5a93af7 to 7895a80 Compare February 8, 2026 16:35
@Praveenrajmani Praveenrajmani force-pushed the alerts branch 2 times, most recently from 63d71f9 to 68bf62f Compare February 18, 2026 09:59
@Praveenrajmani Praveenrajmani changed the title feat: add alerting API and types feat: add alert types for config mismatch, erasure set health, KMS, and storage capacity Mar 25, 2026
@Praveenrajmani Praveenrajmani marked this pull request as ready for review March 25, 2026 15:24
Copy link
Copy Markdown
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall

@ramondeklein
Copy link
Copy Markdown
Contributor

@Praveenrajmani Can you please update the description why this is needed? I guess it's being used in AIStor code to send out alerts?

@klauspost
Copy link
Copy Markdown
Contributor

Honestly it seems overengineered that each alert type must have its own data structure.


// Alert represents a single alert event in the system.
// It captures alert information with contextual metadata including deployment and cluster information.
type Alert struct {
	Type         AlertType    `json:"type"`
	Timestamp    time.Time    `json:"timestamp"`
	Title        string       `json:"title"`
	Message      string       `json:"message"`
	Custom      map[string]string `json:"custom"`
	DeploymentID string       `json:"deploymentId"`
	ClusterName  string       `json:"clusterName"`
	DedupKey     string       `json:"dedupKey,omitempty"`
}

I know you can't extract specific values that easily, but honestly I don't see a need in 99% of cases.

…nd storage capacity

Extends the alerting system with four new AlertType constants and their
corresponding detail structs: ConfigMismatchDetails (peer address, mismatch
type, env/args/endpoint diffs), ErasureSetHealthDetails (drive counts,
write quorum, condition), KMSUnavailableDetails (KMS type), and
StorageCapacityDetails (free/total bytes and percentage).
@Praveenrajmani
Copy link
Copy Markdown
Contributor Author

Yeah, agree @klauspost we dont want individual types. Have simplified it now. PTAL.

@Praveenrajmani Praveenrajmani merged commit 48fa5ea into minio:main Apr 1, 2026
5 checks passed
@Praveenrajmani Praveenrajmani deleted the alerts branch April 1, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants